<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\modules\Admin\models\EpidemicSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '疫情数据';
$this->params['breadcrumbs'][] = $this->title;
?>

<style type="text/css">
    .cs1{margin:5px;}
</style>

<div class="epidemic-index panel panel-body">

    <!-- <h1><、?= Html::encode($this->title) ?></h1> -->

    <p>
        <?= Html::a('创建', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'layout'  =>  "{items}\n{pager}",
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'ep_date',
            'epnum_1',
            'epnum_2',
            'epnum_3',
            'epnum_4',
            'epnum_5',
            'epnum_6',
            'epnum_7',
            'epnum_8',
            //'status',
            //'create_time',
            //'updated_at',

            [
                'label'=>'操作',
                'format'=>'raw',
                'value' => function($model){
                    $url1  = sprintf("/admin/epidemic/view?id=%d", $model->id);
                    $url2  = sprintf("/admin/epidemic/update?id=%d", $model->id);

                    $str = Html::a('查看',$url1,['title' => '查看','class'=>'btn btn-primary btn-xs cs1']);

                    $str .= Html::a('更新',$url2,['title' => '更新','class'=>'btn btn-success btn-xs cs1']);

                    $str .= Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger btn-xs cs1','data' => [
                                'confirm' => Yii::t('app', '你确定要删除吗?'),
                                'method' => 'post',
                            ],]);
                
                    return $str;
                }
            ],
        ],
    ]); ?>


</div>
